// 密码验证
var layer = layui.layer
$('.layui-form').submit(function (e) {
    console.log(1);
    e.preventDefault();
    let data = $(this).serialize();
    $.ajax({
        url: '/api/login',
        type: 'post',
        data: data,
        success: function (res) {
            // console.log(res);
            if (res.status == 0) {
                localStorage.setItem('token', res.token);
                location.href = './index.html'
            } else {
                layer.msg(res.message)
            }
        }
    })
})